home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / array / frmset~1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-07-14  |  7.8 KB  |  225 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H00000000&
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Set Reigion Sample....."
  6.    ClientHeight    =   3810
  7.    ClientLeft      =   2715
  8.    ClientTop       =   2325
  9.    ClientWidth     =   8550
  10.    ControlBox      =   0   'False
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   3810
  15.    ScaleWidth      =   8550
  16.    ShowInTaskbar   =   0   'False
  17.    Begin VB.CommandButton Command5 
  18.       Caption         =   "&Exit"
  19.       Height          =   375
  20.       Left            =   3360
  21.       TabIndex        =   14
  22.       Top             =   3120
  23.       Width           =   1935
  24.    End
  25.    Begin VB.CommandButton Command4 
  26.       BackColor       =   &H00800080&
  27.       Height          =   615
  28.       Left            =   4920
  29.       Style           =   1  'Graphical
  30.       TabIndex        =   9
  31.       Top             =   720
  32.       Width           =   2055
  33.    End
  34.    Begin VB.CommandButton Command3 
  35.       Caption         =   "Set Elliptical Reigion"
  36.       Height          =   375
  37.       Left            =   4320
  38.       TabIndex        =   8
  39.       Top             =   1920
  40.       Width           =   3375
  41.    End
  42.    Begin VB.CommandButton Command2 
  43.       BackColor       =   &H00800080&
  44.       Height          =   615
  45.       Left            =   720
  46.       Style           =   1  'Graphical
  47.       TabIndex        =   1
  48.       Top             =   720
  49.       Width           =   2055
  50.    End
  51.    Begin VB.CommandButton Command1 
  52.       Caption         =   "Set RoundedRectangle Reigion"
  53.       Height          =   375
  54.       Left            =   120
  55.       TabIndex        =   0
  56.       Top             =   1920
  57.       Width           =   3375
  58.    End
  59.    Begin VB.PictureBox Picture4 
  60.       Appearance      =   0  'Flat
  61.       BackColor       =   &H80000005&
  62.       ForeColor       =   &H80000008&
  63.       Height          =   495
  64.       Left            =   480
  65.       Picture         =   "frmsetreigion.frx":0000
  66.       ScaleHeight     =   465
  67.       ScaleWidth      =   465
  68.       TabIndex        =   2
  69.       Top             =   480
  70.       Width           =   495
  71.    End
  72.    Begin VB.PictureBox Picture3 
  73.       Appearance      =   0  'Flat
  74.       BackColor       =   &H80000005&
  75.       ForeColor       =   &H80000008&
  76.       Height          =   495
  77.       Left            =   480
  78.       Picture         =   "frmsetreigion.frx":0363
  79.       ScaleHeight     =   465
  80.       ScaleWidth      =   465
  81.       TabIndex        =   3
  82.       Top             =   1080
  83.       Width           =   495
  84.    End
  85.    Begin VB.PictureBox Picture6 
  86.       Appearance      =   0  'Flat
  87.       BackColor       =   &H80000005&
  88.       ForeColor       =   &H80000008&
  89.       Height          =   495
  90.       Left            =   2520
  91.       Picture         =   "frmsetreigion.frx":06C6
  92.       ScaleHeight     =   465
  93.       ScaleWidth      =   465
  94.       TabIndex        =   5
  95.       Top             =   480
  96.       Width           =   495
  97.    End
  98.    Begin VB.PictureBox Picture5 
  99.       Appearance      =   0  'Flat
  100.       BackColor       =   &H80000005&
  101.       ForeColor       =   &H80000008&
  102.       Height          =   495
  103.       Left            =   2520
  104.       Picture         =   "frmsetreigion.frx":0A29
  105.       ScaleHeight     =   465
  106.       ScaleWidth      =   465
  107.       TabIndex        =   4
  108.       Top             =   1080
  109.       Width           =   495
  110.    End
  111.    Begin VB.PictureBox Picture1 
  112.       Appearance      =   0  'Flat
  113.       BackColor       =   &H80000005&
  114.       ForeColor       =   &H80000008&
  115.       Height          =   495
  116.       Left            =   4680
  117.       Picture         =   "frmsetreigion.frx":0D8C
  118.       ScaleHeight     =   465
  119.       ScaleWidth      =   465
  120.       TabIndex        =   10
  121.       Top             =   480
  122.       Width           =   495
  123.    End
  124.    Begin VB.PictureBox Picture7 
  125.       Appearance      =   0  'Flat
  126.       BackColor       =   &H80000005&
  127.       ForeColor       =   &H80000008&
  128.       Height          =   495
  129.       Left            =   6720
  130.       Picture         =   "frmsetreigion.frx":10EF
  131.       ScaleHeight     =   465
  132.       ScaleWidth      =   465
  133.       TabIndex        =   12
  134.       Top             =   480
  135.       Width           =   495
  136.    End
  137.    Begin VB.PictureBox Picture2 
  138.       Appearance      =   0  'Flat
  139.       BackColor       =   &H80000005&
  140.       ForeColor       =   &H80000008&
  141.       Height          =   495
  142.       Left            =   4680
  143.       Picture         =   "frmsetreigion.frx":1452
  144.       ScaleHeight     =   465
  145.       ScaleWidth      =   465
  146.       TabIndex        =   11
  147.       Top             =   1080
  148.       Width           =   495
  149.    End
  150.    Begin VB.PictureBox Picture8 
  151.       Appearance      =   0  'Flat
  152.       BackColor       =   &H80000005&
  153.       ForeColor       =   &H80000008&
  154.       Height          =   495
  155.       Left            =   6720
  156.       Picture         =   "frmsetreigion.frx":17B5
  157.       ScaleHeight     =   465
  158.       ScaleWidth      =   465
  159.       TabIndex        =   13
  160.       Top             =   1080
  161.       Width           =   495
  162.    End
  163.    Begin VB.Label Label2 
  164.       BackColor       =   &H00000000&
  165.       Caption         =   "nmohsin@yahoo.com"
  166.       ForeColor       =   &H0000C000&
  167.       Height          =   255
  168.       Left            =   3480
  169.       TabIndex        =   7
  170.       Top             =   2880
  171.       Width           =   2055
  172.    End
  173.    Begin VB.Label Label1 
  174.       BackColor       =   &H00000000&
  175.       Caption         =   "           SoftPhoenix  "
  176.       ForeColor       =   &H0000C000&
  177.       Height          =   255
  178.       Left            =   3360
  179.       TabIndex        =   6
  180.       Top             =   2640
  181.       Width           =   2055
  182.    End
  183. Attribute VB_Name = "Form1"
  184. Attribute VB_GlobalNameSpace = False
  185. Attribute VB_Creatable = False
  186. Attribute VB_PredeclaredId = True
  187. Attribute VB_Exposed = False
  188. Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  189. Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
  190. Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
  191. Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As Rect) As Long
  192. Dim RecHandle As Long
  193. Dim EllipHandle As Long
  194. Private Type Rect
  195.    nLeftRect  As Long ' x-coordinate of the region's upper-left corner
  196.    nTopRect As Long ' y-coordinate of the region's upper-left corner
  197.    nRightRect As Long ' x-coordinate of the region's lower-right corner
  198.    nBottomRect As Long ' y-coordinate of the region's lower-right corner
  199.    nWidthEllipse As Long ' height of ellipse for rounded corners
  200.    nHeightEllipse As Long ' width of ellipse for rounded corners
  201. End Type
  202. Dim lpRect  As Rect
  203. Private Sub Command1_Click()
  204. ' set default region of command2 to roundrectangle
  205. SetWindowRgn Command2.hwnd, RecHandle, True
  206. End Sub
  207. Private Sub Command3_Click()
  208. SetWindowRgn Command4.hwnd, EllipHandle, True
  209. End Sub
  210. Private Sub Command5_Click()
  211.     Unload Me
  212. End Sub
  213. Private Sub Form_Load()
  214.   Dim RecDimention As Long
  215.   Dim EllipDimention As Long
  216.   ' get rectacle dimention of command2 button
  217.   RecDimention = GetClientRect(Command2.hwnd, lpRect)
  218.     'create round rectangle reigion
  219.   RecHandle = CreateRoundRectRgn(lpRect.nLeftRect, lpRect.nTopRect, lpRect.nRightRect, lpRect.nBottomRect, 30, 30)
  220.   ' get rectacle dimention of command4 button
  221.   EllipDimention = GetClientRect(Command4.hwnd, lpRect)
  222.     'create ellip rectangle reigion
  223.   EllipHandle = CreateEllipticRgn(lpRect.nLeftRect, lpRect.nTopRect, lpRect.nRightRect, lpRect.nBottomRect)
  224. End Sub
  225.